package com.maila.xiaoaoschool.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import com.android.volley.VolleyError;
import com.cjj.MaterialRefreshLayout;
import com.maila.xiaoaoschool.R;
import com.maila.xiaoaoschool.adapter.CollectAdapter;
import com.maila.xiaoaoschool.api.FindApi;
import com.maila.xiaoaoschool.api.LoginApi;
import com.maila.xiaoaoschool.net.VolleyInterface;
import com.zhy.autolayout.AutoRelativeLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/10/18.
 */

public class CollectionActivity extends AppCompatActivity {
    @BindView(R.id.white_return_iv)
    AutoRelativeLayout whiteReturnIv;
    @BindView(R.id.lv_collection)
    ListView lvCollection;
    @BindView(R.id.hot_refresh)
    MaterialRefreshLayout hotRefresh;
    CollectAdapter collectAdapter;
    private int size=8;
    int page=1;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_collection);
        ButterKnife.bind(this);
        collectAdapter=new CollectAdapter(this);
        lvCollection.setAdapter(collectAdapter);
        initdata();
    }

    /**
     *
     */
    private void initdata() {
        new LoginApi(this, new VolleyInterface() {
            @Override
            public void onSuccess(String result) {

            }

            @Override
            public void onError(VolleyError error) {

            }
        }).get_collection_list(page,size);
    }

    @OnClick(R.id.white_return_iv)
    public void onViewClicked() {
        finish();
    }
}
